#ifndef _MESSAGE_HEADER_H_
#define _MESSAGE_HEADER_H_

#include<iostream>
#include <string>

enum CMD_TYPE
{
	CMD_UNKNOWN = 0,
	CMD_LOGIN,
	CMD_LOGOUT,
	CMD_LOGIN_RESULT,
	CMD_LOGOUT_RESULT,
	CMD_USER_JOIN,
};

class DataHeader
{
public:
	DataHeader()
	{
		m_eType = CMD_UNKNOWN;
		m_iLen = 0;
	}
	virtual~DataHeader() {}
public:
	CMD_TYPE m_eType;
	int m_iLen;
};

class Login : public DataHeader
{
public:
	Login()
	{
		m_eType = CMD_LOGIN;
		m_iLen = sizeof(Login);
	}
	~Login()
	{

	}
public:
	std::string m_strUsername;
	std::string m_strPassword;
};

class LoginResult : public DataHeader
{
public:
	LoginResult()
	{
		m_eType = CMD_LOGIN_RESULT;
		m_iLen = sizeof(LoginResult);
		m_bSuccess = false;
	}
	~LoginResult()
	{

	}
public:
	bool m_bSuccess;
	std::string m_strUsername;
};

class Logout : public DataHeader
{
public:
	Logout()
	{
		m_eType = CMD_LOGOUT;
		m_iLen = sizeof(Logout);
	}
	~Logout()
	{

	}
public:
	std::string m_strUsername;
	std::string m_strPassword;
};

class LogoutResult : public DataHeader
{
public:
	LogoutResult()
	{
		m_eType = CMD_LOGOUT_RESULT;
		m_iLen = sizeof(LogoutResult);
		m_bSuccess = false;
	}
	~LogoutResult()
	{

	}
public:
	bool m_bSuccess;
	std::string m_strUsername;
};

class UserJoin : public DataHeader
{
public:
	UserJoin()
	{
		m_eType = CMD_USER_JOIN;
		m_iLen = sizeof(UserJoin);
	}
	~UserJoin()
	{

	}
};

#endif
